/**
 */

package com.bei_en.common.web;

import java.util.HashMap;
import javax.servlet.http.HttpSession;

/**
 * @author Guocg
 *
 */
public class MySessionContext {

	private static HashMap<Integer, HttpSession> loginMap = new HashMap<Integer, HttpSession>();

	public static synchronized void addSession(Integer uid, HttpSession session) {

		if (uid != null) {
			loginMap.put(uid, session);
		}
	}

	public static synchronized void removeSession(Integer uid) {

		if (uid != null) {
			loginMap.remove(uid);
		}
	}

	public static synchronized HttpSession getSession(Integer uid) {

		if (uid == null)
			return null;
		return loginMap.get(uid);
	}
}